//
//  HeadView.m
//  bestkeep
//
//  Created by mac on 16/12/18.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "HeadView.h"
#import "BK_OD_Color.h"
#import "BK_OD_Tool.h"
@implementation HeadView

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor =[UIColor whiteColor];
        [self initView];
    }
    return self;
}
-(void)initView{
//    _lien =[UIView new];
//    _lien.backgroundColor=[UIColor clearColor];
//    [self.contentView addSubview:_lien];
//    [_lien mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.centerY.equalTo(self.contentView.mas_centerY);
//        make.left.equalTo(self.contentView.mas_left);
//        make.right.equalTo(self.contentView.mas_right);
//        make.height.equalTo(@(0.5));
//    }];
    _comfirmNumber =[UILabel new];
    _comfirmNumber.textColor =[UIColor blackColor];
    _comfirmNumber.text =@"订单号:----";
    _comfirmNumber.font =[UIFont systemFontOfSize:14];
    _comfirmNumber.backgroundColor =[UIColor whiteColor];
    [self.contentView addSubview:_comfirmNumber];
    [_comfirmNumber mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(ApplicationBackGauge);
        make.top.equalTo(self.contentView.mas_top).offset(5);
        make.width.equalTo(@(300));
    }];
    _timelabel =[UILabel new];
    _timelabel.textColor =kOrderMediumGrey;
    _timelabel.text =@"下单时间:----";
    _timelabel.font =[UIFont systemFontOfSize:14];
    _timelabel.backgroundColor=[UIColor whiteColor];
    [self.contentView addSubview:_timelabel];
    [_timelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(ApplicationBackGauge);
        make.top.equalTo(_comfirmNumber.mas_bottom).offset(10);
        make.width.equalTo(@(300));
    }];
    
    UIView *lien2 =[UIView new];
    lien2.backgroundColor =RGB(220, 220, 220);
    
   // lien2.backgroundColor =[UIColor colorWithWhite:0.902 alpha:1.000];
    [self.contentView addSubview:lien2];
    [lien2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left);
        make.right.equalTo(self.contentView.mas_right);
        make.height.equalTo(@(1.3));
        make.top.equalTo(_timelabel.mas_bottom).offset(5);
    }];
    _address = [UILabel new];
    _address.textColor = [UIColor blackColor];
    _address.font =[UIFont systemFontOfSize:17];
    [self.contentView addSubview:_address];
    [_address mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).offset(ApplicationBackGauge);
        make.top.mas_equalTo(lien2.mas_bottom).offset(5);
        make.width.mas_equalTo(@(ScreenWidth));
        make.height.mas_equalTo(@(30));
    }];
    
}

-(void)setModel:(BKMyOrderReturnGoodsModel*)model{
  _model = model;
  _comfirmNumber.text=[NSString stringWithFormat:@"订单号:%@",model.order_no];
 _timelabel.text =[NSString stringWithFormat:@"下单时间:%@",model.order_create_time];
 _address.text = [NSString stringWithFormat:@"%@发货",model.ship_address];
}
-(void)setOrderModel:(BK_My_Order_rows_Model *)orderModel{
    _orderModel = orderModel;
    _comfirmNumber.text=[NSString stringWithFormat:@"订单号:%@",orderModel.order_no];
    _timelabel.text =[NSString stringWithFormat:@"下单时间:%@",orderModel.order_created_date];
    _address.text = [NSString stringWithFormat:@"%@发货",orderModel.deliver];
    
}

@end
